package test;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class GreetingAroundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Object[] arguments = invocation.getArguments();
        String clientName = (String)arguments[0];
        System.out.println("How are you! Mr." + clientName + ".");
        Object ob = invocation.proceed();
        System.out.println("Please enjoy yourself!");
        return ob;
    }
}
